package com.zorn.core.util;

import javax.servlet.http.HttpServletRequest;

public class RequestUtils {

	public static final String XML_HTTP_REQUEST = "XMLHttpRequest", X_REQUESTED_WITH = "x-requested-with";

	public static final boolean isSync(HttpServletRequest request) {
		return !isAsync(request);
	}

	public static final boolean isAsync(HttpServletRequest request) {
		return XML_HTTP_REQUEST.equalsIgnoreCase(request.getHeader(X_REQUESTED_WITH));
	}

}
